package threadpool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Classname FixedThreadPoolOOM
 * @Description 演示newFixedThreadPool出错的情况
 * @Date 2024/1/7 19:37
 * @Author zhuzhenguo
 */
public class FixedThreadPoolOOM {
    private static ExecutorService executorService = Executors.newFixedThreadPool(1);
    public static void main(String[] args) {
        for (int i = 0; i < Integer.MAX_VALUE; i++) {
            // 放特别多的任务
            executorService.execute(new SubThreadTask());
        }
    }
}